package servlet;

import data.QueryLogData;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

@WebServlet(name = "LogQueryServlet")
public class LogQueryServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws IOException {
        String start = request.getParameter("start");
        String end = request.getParameter("end");
        String pageNumber = request.getParameter("pageNumber");
        String pageSize = request.getParameter("pageSize");
        QueryLogData queryRecordData = new QueryLogData(start, end, pageSize,pageNumber);
        String responseText = queryRecordData.query();
        PrintWriter printWriter = response.getWriter();
        printWriter.print(responseText);
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
        doPost(request, response);
    }
}
